package com.eportal.service.impl;

import java.io.File;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.eportal.aop.LogAnnotation;
import com.eportal.api.MdOpenAddAgentJson;
import com.eportal.api.MdOpenAddCommunityJson;
import com.eportal.api.MdOpenApi;
import com.eportal.base.BaseDAO;
import com.eportal.domain.City;
import com.eportal.domain.Sysopt;
import com.eportal.domain.TAgent;
import com.eportal.domain.TCommunity;
import com.eportal.domain.TMirrorAgent;
import com.eportal.exception.MdKnownRunTimeException;
import com.eportal.service.SysOptService;
import com.eportal.service.SysRolesTemplateService;
import com.eportal.service.TAgentService;
import com.eportal.service.TMirrorAgentService;
import com.eportal.util.Config;
import com.eportal.util.MD5;
import com.eportal.util.UploadUtil;
import com.eportal.util.ValidateUtil;
import com.framework.jqgrid.JqGridPager;

/**
 * 角色管理业务逻辑接口实现
 */
@Service("tMirrorAgentService")
public class TMirrorAgentServiceImpl implements TMirrorAgentService {
	private Map<String, Object> result = new HashMap<String, Object>();
	private static Logger log = Logger.getLogger(TMirrorAgentServiceImpl.class.getName());
	@Resource(name="dao")
	private BaseDAO dao;
	
	public HttpSession getSession() {
        return ServletActionContext.getRequest().getSession();
    }

	@Override
	public List<Map> list(JqGridPager jqGridPager) {
		String sql = "select * from TMirror_Agent";
		return dao.query(sql, jqGridPager);
	}

	@Override
	public TMirrorAgent get(Long id) {
		// TODO Auto-generated method stub
		return (TMirrorAgent)dao.getById(TMirrorAgent.class, id);
	}

	@Override
	public void delete(Long id) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void update(TMirrorAgent tAgent) throws Exception {
		dao.update(tAgent);
		
	}

	@Override
	public void save(TMirrorAgent tAgent) throws Exception {
		dao.save(tAgent);
		
	}

	@Override
	public List<TMirrorAgent> listAllForWxXcx() {
		return dao.query("from TMirrorAgent where gtype='3'");
	}
  

}
